<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
   <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>商品管理</title>
    <!-- Tell the browser to be responsive to screen width -->
    <meta content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no" name="viewport">
    <link rel="stylesheet" href="operator/plugins/bootstrap/css/bootstrap.min.css">
    <link rel="stylesheet" href="operator/plugins/adminLTE/css/AdminLTE.css">
    <link rel="stylesheet" href="operator/plugins/adminLTE/css/skins/_all-skins.min.css">
    <link rel="stylesheet" href="operator/css/style.css">
	<script src="operator/plugins/jQuery/jquery-2.2.3.min.js"></script>
    <script src="operator/plugins/bootstrap/js/bootstrap.min.js"></script>
	<script src="operator/plugins/angularjs/angular.min.js"></script>
	<!-- 分页组件开始 -->
	<script src="operator/plugins/angularjs/pagination.js"></script>
	<link rel="stylesheet" href="operator/plugins/angularjs/pagination.css">
	<!-- 分页组件结束 -->
	<script src="angularjs_file/public/base_pagination.js"></script>
	<script src="angularjs_file/service/operatorGoodsService.js"></script>
	<script src="angularjs_file/controller/operatorGoodsController.js"></script>
</head>

<body class="hold-transition skin-red sidebar-mini" ng-app="shopOnline" ng-controller="goodsAuditedController" ng-init="reloadList()">
  <!-- .box-body -->
                    <div class="box-header with-border">
                        <h3 class="box-title">商品审核</h3>
                    </div>

                    <div class="box-body">

                        <!-- 数据表格 -->
                        <div class="table-box">

                            <!--工具栏-->
                            <div class="pull-left">
                                <div class="form-group form-inline">
                                    <div class="btn-group">
                                        <button type="button" class="btn btn-default" title="删除" ng-click="dele()"><i class="fa fa-trash-o"></i> 删除</button>
                                        <button type="button" class="btn btn-default" title="审核通过" ng-click="updateGoodsStatusPass()"><i class="fa fa-check"></i> 审核通过</button>
                                        <button type="button" class="btn btn-default" title="驳回" ng-click="updateGoodsStatusRefuse()"><i class="fa fa-ban"></i> 驳回</button>                                  
                                        <button type="button" class="btn btn-default" title="刷新" ng-click="refreshGoodsList()"><i class="fa fa-refresh"></i> 刷新</button>
                                    </div>
                                </div>
                            </div>
                            <div class="box-tools pull-right">
                                <div class="has-feedback">
                                    商品名称：<input ng-model="searchEntity.goodsName">
									<button class="btn btn-default" ng-click="reloadList()">查询</button>                                    
                                </div>
                            </div>
                            <!--工具栏/-->

			                  <!--数据列表-->
			                  <table id="dataList" class="table table-bordered table-striped table-hover dataTable">
			                      <thead>
			                          <tr>
			                              <th class="" style="padding-right:0px">
			                                  <input id="selall" type="checkbox" class="icheckbox_square-blue">
			                              </th> 
										  <th class="sorting_asc">商品ID</th>
									      <th class="sorting">商品名称</th>
									      <th class="sorting">商品价格</th>
									      <th class="sorting">一级分类</th>
									      <th class="sorting">二级分类</th>
									      <th class="sorting">三级分类</th>
									      <th class="sorting">状态</th>									     						
					                      <th class="text-center">操作</th>
			                          </tr>
			                      </thead>
			                      <tbody>
			                          <tr ng-repeat="goods in goodsAuditedlist">
			                              <td><input type="checkbox" ng-click="updateSelection($event,goods.id)"></td>			                              
				                          <td ng-model="id">{{goods.id}}</td>
									      <td>{{goods.goodsName}}</td>
									      <td>{{goods.price}}</td>
									      <td>{{goods.category1Id}}</td>
									      <td>{{goods.category2Id}}</td>
									      <td>{{goods.category3Id}}</td>
		                                  <td >		                                  
		                                  	<span ng-model="status">
		                                  		{{status[goods.auditStatus]}}
		                                  	</span>
		                                  	
		                                  </td>		                                  
		                                  <td class="text-center">                                          
		                                 	  <button type="button" class="btn bg-olive btn-xs" data-toggle="modal" data-target="#editModal" ng-click="showGoodsDetails(goods.id)">详情</button>
		                                  </td>
			                          </tr>
			                      </tbody>
			                  </table>
			                  <!--数据列表/-->                        
							  <tm-pagination conf="paginationConf"></tm-pagination>
                        </div>
                        <!-- 数据表格 /-->
                        
                        
                     </div>
                    <!-- /.box-body -->
 <div class="modal fade" id="editModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  <div class="modal-dialog" style="width: 1020px;">
	<div class="modal-content">
		<div class="modal-header">
			<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
			<h3 id="myModalLabel">商品详情</h3>
		</div>
		<div class="modal-body" class="hold-transition skin-red sidebar-mini" >							
			 <!-- 正文区域 -->
            <section class="content">

                <div class="box-body">

                    <!--tab页-->
                    <div class="nav-tabs-custom">

                        <!--tab头-->
                        <ul class="nav nav-tabs">                       		
                            <li class="active">
                                <a href="#home" data-toggle="tab">商品基本信息</a>                                                        
                            </li>   
                            <li >
                                <a href="#pic_upload" data-toggle="tab" ng-click="showPicture(goods.id)">商品图片</a>                                                        
                            </li>    
                            <li >
                                <a href="#customAttribute" data-toggle="tab">扩展属性</a>                                                        
                            </li>     
                            <li >
                                <a href="#spec" data-toggle="tab" >规格</a>                                                        
                            </li>                       
                        </ul>
                        <!--tab头/-->
						
                        <!--tab内容-->
                        <div class="tab-content">

                            <!--表单内容-->
                            <div class="tab-pane active" id="home">
                                <div class="row data-type">                                  
								   <div class="col-md-2 title">商品分类</div>
		                          
		                           	  <div class="col-md-10 data">
		                           	  	<table>
		                           	  		<tr>
		                           	  			<td>
		                           	  				<span class="form-control">一级分类：{{entity.goods.category1Id}}</span>
		                              			</td>
		                              			<td>
		                           	  				<span class="form-control">二级分类：{{entity.goods.category2Id}}</span>
		                              			</td>
		                              			<td>
		                           	  				<span class="form-control">三级分类：{{entity.goods.category3Id}}</span>
		                              			</td>
		                              			<td>
		                              			<span class="form-control">模板ID:{{entity.goods.typeTemplateId}}</span>
		                              			</td>
		                           	  		</tr>
		                           	  	</table>
		                              	
		                              </div>	                              
		                          	  
									
		                           <div class="col-md-2 title">商品名称</div>
		                           <div class="col-md-10 data">
		                               <span class="form-control">{{entity.goods.goodsName}}</span>
		                           </div>
		                           
		                           <div class="col-md-2 title">品牌</div>
		                           <div class="col-md-10 data">
		                              <span class="form-control">{{entity.goodsBrand.name}}</span>
		                           </div>
		
								   <div class="col-md-2 title">副标题</div>
		                           <div class="col-md-10 data">
		                               <span class="form-control">{{entity.goods.caption}}</span>
		                           </div>
		                           
		                           <div class="col-md-2 title">价格</div>
		                           <div class="col-md-10 data">
		                           	   <div class="input-group">
			                          	   <span class="input-group-addon">¥</span>
			                               <span class="form-control">{{entity.goods.price}}</span>
		                           	   </div>
		                           </div>
		                           
		                           <div class="col-md-2 title editer">商品介绍</div>
                                   <div class="col-md-10 data editer">
                                   	   <textarea name="content" style="width:800px;height:400px;" readonly>{{entity.goods_desc.introduction}}</textarea>
                                   </div>
		                           
		                           <div class="col-md-2 title rowHeight2x" readonly>包装列表</div>
		                           <div class="col-md-10 data rowHeight2x">
		                           		<textarea rows="4"  class="form-control" readonly>{{entity.goods_desc.packageList}}</textarea>
		                           </div>
		                           
		                           <div class="col-md-2 title rowHeight2x">售后服务</div>
		                           <div class="col-md-10 data rowHeight2x">
		                           		<textarea rows="4"  class="form-control"  readonly>{{entity.goods_desc.saleService}}</textarea>
		                           </div>  
                                </div>
                            </div>
                            
                            <!--图片上传-->
                            <div class="tab-pane" id="pic_upload">
                                <div class="row data-type"> 
									 <table class="table table-bordered table-striped table-hover dataTable">
					                    <thead>
					                        <tr>
											    <th class="sorting" style="width:340px;">颜色</th>
											    <th class="sorting" style="width:680px;">图片</th>		
											</tr>					            
										 </thead>
					                    <tbody>
					                      <tr ng-repeat="itemImage in entity.goods_desc.itemImages">					                           
									            <td>
									            	<span>{{itemImage.color}}</span>
									            </td>
									            <td>
									           		<img alt="正在加载中" src="{{itemImage.url}}" width="100px" height="100px">	            	 
									            </td>
					                      </tr>
					                    </tbody>
									 </table> 
                                </div>
                            </div>
                           
                           
                           <!--扩展属性-->
                            <div class="tab-pane" id="customAttribute">
                                <div class="row data-type">                                
	                                <div ng-repeat="pojo in entity.goods_desc.customAttributeItems">
		                                <div class="col-md-2 title">{{pojo.text}}</div>
				                        <div class="col-md-10 data">
				                              <input class="form-control" value="{{pojo.value}}" readonly>            	 
				                        </div>
	                                </div>	
                                </div>
                            </div>
                      
                            <!--规格-->
                            <div class="tab-pane" id="spec">
                            	<p>
                            	<div>
	                                
	                                <div class="row data-type">
	                                	 <table class="table table-bordered table-striped table-hover dataTable">
						                    <thead>
						                        <tr>
													<th class="sorting" style="width:400px;">规格</th>
													<th class="sorting" style="width:60px;">图片</th>
												    <th class="sorting" style="width:200px;">价格</th>
												    <th class="sorting" style="width:200px;">库存</th>
												    <th class="sorting" style="width:90px;">是否启用</th>
												    <th class="sorting" style="width:90px;">是否默认</th>
											    </tr>
								            </thead>
						                    <tbody>
						                      <tr  ng-repeat="goodsitem in entity.itemList">					                           
										            <td>
										            	<input class="form-control"  value="{{goodsitem.spec}}" readonly>
										            </td>
										            <td>
										            	<img alt="" src="{{goodsitem.image}}" width="40px" height="40px">
										            </td>
										            <td>
										           		<input class="form-control" style="width:180px;"  value="{{goodsitem.price}}" readonly>
										            </td>
										            <td>
										            	<input class="form-control" style="width:180px;" value="{{goodsitem.num}}" readonly>
										            </td>
										            <td>
										            	<input class="form-control" style="width:70px;" value="{{isStatus[goodsitem.status]}}" readonly>
										            </td>
										            <td>
										             	<input class="form-control" style="width:70px;"  value="{{isDefaulted[goodsitem.isDefault]}}" readonly>
										            </td>
						                      </tr>
						                    </tbody>
									 	</table>
								
	                                </div>
	                                
	                            </div>
                            </div>
                            
                        </div>
                        <!--tab内容/-->
						<!--表单内容/-->
							 
                    </div>
                 	
                 	
                 	
                 	
                   </div>
            </section>
		</div>
		<div class="modal-footer">						
			<div>商品详情页</div>
		</div>
	  </div>
	</div>
</div> 
        
</body>

</html>